<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>添加/修改 - 系统设置 - H-ui.admin v3.1</title>
<meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>系统设置<span class="c-gray en">&gt;</span> 系统设置 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add">
		<input type="hidden" class="input-text" value="{$data.id}" id="id" name="id">
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2"><span class="c-red">*</span>后台名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.web_title}" placeholder="后台名称" id="web_title" name="web_title">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">后台图标：</label>
			<div class="formControls col-xs-8 col-sm-9">
                <div style="position:relative;" id="drop_area"></div>
                <p style="color:#ccc;font-size:12px;">建议尺寸宽高:1:1</p>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">公司公告：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.web_intro}" placeholder="公司公告" id="web_intro" name="web_intro">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">SEO 关键字：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.seo_keyword}" placeholder="SEO 关键字" id="seo_keyword" name="seo_keyword">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">SEO 描述：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea class="form-control" placeholder="SEO 描述" name="seo_desc" cols="50" rows="5">{$data['seo_desc']}</textarea>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">是否开启评论：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<label class="radio-inline">
					<input type="radio" id="emailwy1" name="open_comment" value="0" {if $data['open_comment']==0}checked{/if} />
					<label for="emailwy1">关闭</label>
				</label>
				<label class="radio-inline">
					<input type="radio" id="emailwy2" name="open_comment" value="1" {if $data['open_comment']==1}checked{/if} />
					<label for="emailwy2">开启</label>
				</label>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">是否开启评论审核：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<label class="radio-inline">
					<input type="radio" id="emailwy1" name="check_comment" value="0" {if $data['check_comment']==0}checked{/if} />
					<label for="emailwy1">关闭</label>
				</label>
				<label class="radio-inline">
					<input type="radio" id="emailwy2" name="check_comment" value="1" {if $data['check_comment']==1}checked{/if} />
					<label for="emailwy2">开启</label>
				</label>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">评论时间间隔：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.comment_titmes}" placeholder="评论时间间隔" id="comment_titmes" name="comment_titmes">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">分享首页标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.share_title}" placeholder="分享首页标题" id="share_title" name="share_title">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">海报分享图：</label>
			<div class="formControls col-xs-8 col-sm-9">
                <div style="position:relative;" id="drop_areao"></div>
                <p style="color:#ccc;font-size:12px;">建议尺寸宽高:2:1</p>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">表单提示邮箱：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.email}" placeholder="表单提示邮箱" id="email" name="email">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">发送内容邮箱：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.from_email}" placeholder="发送内容邮箱" id="from_email" name="from_email">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">邮箱授权码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.email_code}" placeholder="邮箱授权码" id="email_code" name="email_code">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">是否开启页底信息：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<label class="radio-inline">
					<input type="radio" id="emailwy1" name="footer_show" value="0" {if $data['footer_show']==0}checked{/if} />
					<label for="emailwy1">关闭</label>
				</label>
				<label class="radio-inline">
					<input type="radio" id="emailwy2" name="footer_show" value="1" {if $data['footer_show']==1}checked{/if} />
					<label for="emailwy2">开启</label>
				</label>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">页底信息作用：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<label class="radio-inline">
					<input type="radio" id="emailwy1" name="footer_use" value="0" {if $data['footer_use']==0}checked{/if} />
					<label for="emailwy1">无作用</label>
				</label>
				<label class="radio-inline">
					<input type="radio" id="emailwy2" name="footer_use" value="1" {if $data['footer_use']==1}checked{/if} />
					<label for="emailwy2">拨打电话</label>
				</label>
				<label class="radio-inline">
					<input type="radio" id="emailwy2" name="footer_use" value="2" {if $data['footer_use']==2}checked{/if} />
					<label for="emailwy2">跳转小程序</label>
				</label>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-3 col-sm-offset-2">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去--> 
<script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript" src="/static/js/upload.js"></script>
<script type="text/javascript">
var imgpz;
var imgpzo;
$(function(){
	$('#drop_area div img').attr('src','{$data.img}');
	$('#drop_area div img').attr('onerror',"javascript:this.src='/static/img/upload.png'");
	$('#drop_areao div img').attr('src','{$data.share_img}');
	$('#drop_areao div img').attr('onerror',"javascript:this.src='/static/img/upload.png'");
	if($("#drop_area div img").attr('src')=='/static/img/upload.png'){
		imgpz='';
	}else{
		imgpz= $("#drop_area div img").attr('src');
	}
	if($("#drop_areao div img").attr('src')=='/static/img/upload.png'){
		imgpzo='';
	}else{
		imgpzo= $("#drop_areao div img").attr('src');
	}
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#form-admin-add").validate({
		rules:{
			// password:{
			// 	required:true,
			// }
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				type: 'post',
				url: "{:url('system_set')}",
				data:{img:imgpz,share_img:imgpzo},
				success: function(data){
					if(data.code==200){
						layer.msg('成功！',{icon:1,time:3000});
					}else{
						layer.msg('失败！',{icon:2,time:3000});
					}

				},
                error: function(XmlHttpRequest, textStatus, errorThrown){
						layer.msg('失败！',{icon:2,time:3000});
				}
			});
		}
	});
});
var dragImgUpload = new DragImgUpload("#drop_area",{
    callback:function (files) {
        //回调函数，可以传递给后台等等
        if(files[0].size<3145728){
	        var file = files[0];
	        var formData = new FormData();
	        formData.append("file",file);
	        $.ajax({
	              type: 'POST',
	              url: "{:url('qiniuupload')}",
	              data:formData,
	              contentType: false, /*不可缺*/
	              processData: false, /*不可缺*/
	              success: function(response){
	                if(response.code==200){
	                  imgpz=response.data
	                }else{
	                  alert(response.msg);
	                }
	              },
	              error: function(err){

	              }
	        })
        }else{
        	alert('出错');
        	location.replace(location.href);
        }
    }
})
var dragImgUploado = new DragImgUpload("#drop_areao",{
    callback:function (files) {
        //回调函数，可以传递给后台等等
        if(files[0].size<3145728){
	        var file = files[0];
	        var formData = new FormData();
	        formData.append("file",file);
	        $.ajax({
	              type: 'POST',
	              url: "{:url('qiniuupload')}",
	              data:formData,
	              contentType: false, /*不可缺*/
	              processData: false, /*不可缺*/
	              success: function(response){
	                if(response.code==200){
	                  imgpzo=response.data
	                }else{
	                  alert(response.msg);
	                }
	              },
	              error: function(err){

	              }
	        })
        }else{
        	alert('出错');
        	location.replace(location.href);
        }
    }
})
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>